The AUTOLAUNCH Sample accompanies Chapter 12 and illustrates how to launch an application automatically upon device attachment.
The sample includes four components:
To build TSTLNCH.SYS, follow the general instructions for building a WDM sample. The Microsoft Visual C++ project file is named TSTLNCH.DSP in the SYS subdirectory.
To build the other components, follow the general instructions for building user-mode programs. The Microsoft Visual C++ project files are named AUTOLAUNCH.DSP, ALTEST.DSP, and STARTSERVICE.DSP in the AUTOLAUNCH, ALTEST, and STARTSERVICE subdirectories, respectively.
The AUTOLAUNCH project contains subprojects for the Windows 2000 service and the Windows 98 pseudo-service. Don't forget to build both subprojects.
Install the TSTLNCH "device." Follow the general instructions for using FastInst in Windows 2000 or the Add New Hardware wizard in Windows 98. The INF file is named SYS\DEVICE.INF.
Installing the TSTLNCH device automatically starts the AUTOLAUNCH or ALNCH98 service, which in turn automatically invokes ALTEST. You should expect to see a dialog box on the screen indicating the automatic invocation of ALTEST.
To prevent the AUTOLAUNCH service from running in this and future sessions of Windows 2000, open a command prompt and issue these two commands:
C:\>net stop autolaunch
C:\>autolaunch -unregister
To prevent the ALNCH98 applet from running in this and future sessions of Windows 98, follow this procedure:
AUTOLAUNCH is an exception to the blanket license to use the sample programs for this book. The author will grant a royalty-free license to anyone to redistribute AUTOLAUNCH as part of a WDM driver package. The license will, however, include conditions designed to insure the consistency and quality of AUTOLAUNCH on end user machines. Send e-mail to waltoney@oneysoft.com for information about obtaining this conditional license.